import router from 'vue-router'
import Vue from 'vue'
import Layout from '../Layout'

Vue.use(router)

const routes = [
    {
        path: '',
        component: Layout,
        redirect: 'homePage',
        children: [
            {
                path: 'homePage',
                component: () => import("@/views/homePage"),
                meta: {
                    title: '首页'
                }
            },
            {
                path: 'userCenter',
                component: () => import("@/views/userCenter"),
                meta: {
                    title: '用户中心'
                }
            },
            {
                path: 'blogPage',
                component: () => import("@/views/blogPage"),
                meta: {
                    title: '博客'
                }
            },
            {
                path: 'page1',
                component: () => import("@/views/page1"),
                meta: {
                    title: 'page1'
                }
            },
            {
                path: 'page2',
                component: () => import("@/views/page2"),
                meta: {
                    title: 'page2'
                }
            },
            {
                path: 'iframe',
                component: () => import("@/views/iframePage"),
                meta: {
                    title: 'iframe'
                }
            },
            {
                path: 'processModel',
                component: () => import("@/views/processModel"),
                meta: {
                    title: 'processModel'
                }
            }
        ]
    },
    {
        path: '/login',
        component: () => import("@/views/loginPage"),
        meta: {
            title: '登录页'
        }
    }
]

export default new router({
    base: '/',
    mode: 'history',
    routes,
})
